package com.fengye.serialization.serializer;

/**
 * @Author fengye
 * @Date 2023/2/12 11:43
 **/
public interface Serializer {

    /**
     * 序列化
     * @param obj
     * @return
     * @param <T>
     */
    public <T> byte[] serialize(T obj) throws Exception;

    /**
     * 反序列化
     * @param data
     * @param clazz
     * @return
     * @param <T>
     */
    public <T> T deserialize(byte[] data, Class<T> clazz) throws Exception;
}
